//
//  BuyViewController.m
//  CaiPiao
//
//  Created by zhoup on 16/5/25.
//  Copyright © 2016年 zhoup. All rights reserved.
//

#import "BuyViewController.h"

@interface BuyViewController ()


@property(nonatomic,strong) UIView *menuView;
@end

@implementation BuyViewController

-(UIView *)menuView
{
    if (!_menuView) {
        _menuView = [[UIView alloc]init];
        
        _menuView.frame = CGRectMake(0, 64, 200, 200);
        _menuView.center = self.view.center;
        _menuView.y = 64;
        [_menuView setBackgroundColor:[UIColor blueColor]];
        [self.view addSubview:_menuView];
    }
    return _menuView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.menuView.height = 0;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
- (IBAction)menuBtnClicked:(UIButton *)sender {
    [UIView animateWithDuration:0.3 animations:^{
        if (CGAffineTransformIsIdentity(sender.imageView.transform)) {
             sender.imageView.transform = CGAffineTransformMakeRotation(M_PI);
            
            self.menuView.height = 100;
        }
        else
        {
            sender.imageView.transform = CGAffineTransformIdentity;
            self.menuView.height = 0;
        }
       
    }];
    
    NSLog(@"%@",NSStringFromCGRect(self.menuView.frame));
}

@end
